﻿@model wychuan2.com.Areas.admin.Models.LiCai.LiCaiModel

@{
    var detail = Model.LiCaiDetails.First();
}
<form class="form-horizontal">
    <input type="hidden" name="Id" value="@detail.Id" />
    <div class="form-group">
        <label class="control-label col-sm-2">买入金额</label>
        <div class="col-sm-10">
            <div class="input-group">
                <span class="input-group-addon">¥</span>
                <input type="text" name="txtPrice" value="@detail.Price" class="form-control input-sm" placeholder="买入金额" />
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-2">购买账户</label>
        <div class="col-sm-10">
            <select class="form-control input-sm" name="selAccount">
                @foreach (var account in Model.Accounts)
                {
                    <option @(account.Id == detail.AccountId ? "selected" : "") value="@account.Id">@account.Name</option>
                }
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-2">购买日期</label>
        <div class="col-sm-10">
            <input type="text" name="txtBuyDay" class="form-control input-sm datetimepicker" value="@detail.BuyDay.ToString("yyyy-MM-dd")" />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-2">购买周期</label>
        <div class="col-sm-10">
            <div class="input-group">
                <input type="text" name="txtTimes" class="form-control input-sm text-right" placeholder="输入周期" value="@detail.Times" />
                <div class="input-group-btn" style="width:auto;">
                    <select name="selTimeUnit" class="form-control input-sm">
                        <option @("天".Equals(detail.TimeUnit) ? "selected" : "") value="天">天</option>
                        <option @("月".Equals(detail.TimeUnit) ? "selected" : "") value="月">月</option>
                        <option @("年".Equals(detail.TimeUnit) ? "selected" : "") value="年">年</option>
                    </select>
                </div>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-2">到期时间</label>
        <div class="col-sm-10">
            <input type="text" name="txtExpireDay" class="form-control input-sm datetimepicker" placeholder="到期时间" value="@(detail.ExpireDay.HasValue?detail.ExpireDay.Value.ToString("yyyy-MM-dd"):string.Empty)" />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-2">年息率</label>
        <div class="col-sm-10">
            <div class="input-group">
                <input type="text" name="txtInterestRate" class="form-control input-sm text-right" placeholder="输入年息率" value="@detail.InterestRate">
                <span class="input-group-addon input-sm">%</span>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">项目描述</label>
        <div class="col-sm-10">
            <input type="text" name="txtProject" value="@detail.Project" class="form-control" placeholder="输入项目描述" />
        </div>
    </div>
</form>